import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

public class gson {
    public static void main(String[] args) throws MalformedURLException {

        URL s = new URL("http://www.mctuoluo.com/1.png");
        System.out.println(s.toString());

        Map<String,Object> map = new HashMap<String,Object>();
        map.put("name","ME_shitou");
        map.put("type",1);
        map.put("msg","");
        map.put("server","lobbu1");
        Gson gson = new Gson();
        gson.toJson(map);
        System.out.println(gson.toJson(map).toString());
        JsonObject jsonObject = new JsonParser().parse(gson.toJson(map)).getAsJsonObject();
        if (jsonObject.has("msg")){
            System.out.println(1);
        }
        System.out.println(2);
    }

    public void onEnable(){
    }
}
